# -*- coding: utf-8 -*-
# @Time    : 2020/3/17 10:20
# @Author  : Sunny
# @Site    : 
# @File    : encrypt.py
# @Software: PyCharm
# @WeChat public address : 程序猿与python之间的秘密
import hashlib

from django.conf import settings


def md5(string):
    """ MD5加密 """
    hash_object = hashlib.md5(settings.SECRET_KEY.encode('utf-8'))
    hash_object.update(string.encode('utf-8'))
    return hash_object.hexdigest()
